export default class Watcher{
    constructor(vm, key, value) {
        this.vm = vm
        this.key = key
        this.oldValue = value
        this.callback = vm.$callback[key]
    }

    update(){
        let newValue = this.vm.$data[this.key]
        if(this.oldValue !== newValue){
            this.callback && this.callback(newValue)
        }
    }
}